------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads/4_Log/6_DataFigs.log
  log type:  text
 opened on:  20 Jan 2023, 16:01:07

. 
. set scheme plotplain

. 
. use "1_Data/AC_pre-delim_dataset.dta", clear
(Written by R.              )

. 
. **if reported votes votes_1 is 0 this means it is uncontested elections
. drop if votes_1==0 | votes_1==.
(0 observations deleted)

. drop if votes1_t1==0 | votes1_t1==.
(0 observations deleted)

. 
. drop if pollpercentc_1==0 | pollpercentc_1==.
(0 observations deleted)

. drop if pollpercentc1_t1==0 | pollpercentc1_t1==.
(0 observations deleted)

. 
. **drop very low number of villages
. **drop if nvillagesabs<=10
. drop if nvillagesabs<20
(0 observations deleted)

. 
. *drop if nvillagesabs<10 & census_totpop<.05*nelectors
. **kerala has odd village structure
. drop if state=="kerala"
(0 observations deleted)

. 
. 
. drop if groupcode!="t01"
(0 observations deleted)

. 
. hist percenteligiblevillage500, frequency ylabel(,format(%13.0g)) xtitle("% villages in a constituency that are over 500/250 population") name
> (insthist)
(bin=34, start=1.8518518, width=2.8867102)

. graph export "3_Figs/Fig3B.pdf", as(pdf) replace
(file /Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads/3_Figs/Fig3B.pdf written in PDF format)

. 
. use "1_Data/censusvillageroads.dta", clear
(Written by R.              )

. 
. egen statename = group(state)

. 
. egen statedistrict = group(districtid stateid)

. 
. gen pmgsyroad = 0

. replace pmgsyroad = 1 if roadcode>0 & roadcode!=.
(101,467 real changes made)

. 
. gen pmgsyroad2008 = 0 if roadsanction_period==. | roadsanction_period==3|roadsanction_period==4
(94,731 missing values generated)

. replace pmgsyroad2008 = 1 if roadsanction_period==1| roadsanction_period==2
(94,731 real changes made)

. 
. keep if stateid!=32
(1,364 observations deleted)

. 
. **road in 2001 - is there road in baseline villages in 2001?
. gen pavedroad2001 = pc01_vd_app_pr
(26,521 missing values generated)

. 
. gen villagepop= pc01_vd_t_p

. 
. gen popcutoff500 = villagepop-500

. set scheme plotplain

. 
. binscatter pmgsyroad villagepop if villagepop>=1 & villagepop<=3000 , nquantiles(20) xtitle("Population (Census 2001)") ytitle("Probability of
>  PMGSY connectivity by 2018") linetype(none) msymbol(solid) xlabel(0(250)3000, nogrid)
(note:  named style solid not found in class symbol, default attributes used)

. graph export "3_Figs/Fig2B.pdf", as(pdf) replace
(file /Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads/3_Figs/Fig2B.pdf written in PDF format)

. 
. hist villagepop if villagepop>=1 & villagepop<=3000, freq ylabel(,format(%13.0g)) xtitle("Population (Census 2001)")
(bin=56, start=1, width=53.553571)

. graph export "3_Figs/Fig2A.pdf", as(pdf) replace
(file /Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads/3_Figs/Fig2A.pdf written in PDF format)

. log close
      name:  <unnamed>
       log:  /Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads/4_Log/6_DataFigs.log
  log type:  text
 closed on:  20 Jan 2023, 16:01:09
------------------------------------------------------------------------------------------------------------------------------------------------
